package com.example.wnn.web.controller;


import com.example.wnn.utils.IpUtils;
import com.example.wnn.web.vo.Pson;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.net.InetAddress;
import java.net.UnknownHostException;

@Slf4j
@RestController
//@CrossOrigin(origins = "http://localhost:8080")
@RequestMapping("/api/vue/test")
public class VueTestController {

    @GetMapping
    public String test() {
        return "hello word GET请求";
    }

    @PostMapping("/t1")
    public Pson test1( Pson pson){
        pson.setName("张三");
        pson.setAge(12);
        return pson;
    }

    @PostMapping("/t2")
    public Pson test2(@RequestBody Pson pson){
        pson.setName("张三");
        pson.setAge(12);
        return pson;
    }

    @GetMapping("/t3")
    public Integer test3(){
        return 100;
    }

}
